package chapter01;

import java.util.Scanner;

public class Test08_Day {
    public static void main(String[] args) {
        //计算给出月份的天数
        System.out.println("请输入年和月");
        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();
        int month = scanner.nextInt();
        //判断是否是闰年
        boolean flag = year%4==0&&year%100!=0||year%400==0;
        if(month==1|month==3|month==5|month==7|month==8|month==10|month==12){
            System.out.println("该月份是31天");
        }else if(month==4|month==6|month==9|month==11){
            System.out.println("该月份是30天");
        } else if (month==2) {
            if(flag){
                System.out.println("该月份是29天");
            }else{
                System.out.println("该月份是28天");
            }
        }
    }
}
